<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
     <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%@include file="publicJSCSS.jsp"%>

<jsp:include page="../HRTWEB/address/show.jsp"></jsp:include>

<script src="<%=request.getContextPath() %>/HRTWEB/js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/HRTWEB/js/buyGift.js"></script>
<script src="<%=request.getContextPath()%>/HRTWEB/js/bootstrap.min.js"></script>
<script src="<%=request.getContextPath()%>/HRTWEB/js/jquery.form.js"></script>
<!-- 表单验证 -->
	<script type="text/javascript" src="<%=request.getContextPath()%>/HRTWEB/js/validforms/Validform_v5.3.2.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/HRTWEB/js/validforms/verification.js"></script>
	<link rel="stylesheet" href="<%=request.getContextPath()%>/HRTWEB/css/Validform_css.css" />
	
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/HRTWEB/css/publicCss.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/HRTWEB/css/buyGift.css">
<link href="<%=request.getContextPath() %>/HRTWEB/css/bootstrap.min.css" rel="stylesheet" />
<title>立即购买</title>
</head>
<body>
<%@include file="head.jsp"%>
<div id="publicMain">
    <div class="buyGift-div" >
												
	<table class=" buyGift-table" cellspacing="0" cellpadding="0" id="addressBookTable">
	    <tr>
            <td class="buyGift-table-bboder" colspan="2">确认收货地址</td>
            <!-- <td class="buyGift-table-bboder"><a href="javascript::">管理收货地址</a></td> -->
        </tr>
		
	    <tr>
            <%-- <td><input type="radio" id="isUse"  name="isUse" addressId="${address.id}"/><span id="province">${address.province}</span><div><button addressId="${address.id}" memberId="${hrtMember.id}" id="setDefaultBtn">设为默认</button></div></td>
            <td class="buyGift"><button type="button" id="editBtn" data-toggle="modal" memberId="${hrtMember.id}" addressId="${address.id}">修改本地址</button></td> --%>
            <td colspan="3">
            <div class="inner">
				 <ul>
					<c:forEach var="address" items="${addressList}">
						<c:if test="${address.isdefault==1}">
				            <li>
					            <div class="innerDIV" id="address${address.id}" isselected="false" objId="${address.id}" style="border: 1px #963 solid;">
				                       <div style="height: 20px">
					                      <span>${address.province}</span>
					                      <span>${address.city}</span>
					                      <span>(</span>
					                      <span>${address.receiver}收</span>
					                      <span>)</span>
					                  </div>
					                  <div style="height: 50px">
					                      <span>${address.area}</span>
					                      <span>${address.address}</span>
					                      <span>${address.mobile}</span>
					                  </div>
					                  <div style="height: 20px;vertical-align:bottom;position:relative;">
						                  <a href="#" id="editBtn" data-toggle="modal" memberId="${hrtMember.id}" addressId="${address.id}">修改</a>
						                  <a href="#" addressId="${address.id}" memberId="${hrtMember.id}" id="setDefaultBtn">设为默认</a>
						                 <%--  <div class="curmarker" id="curmarker${address.id}"></div> --%>
						                 <div class="minPicture" style="visibility:visible" isselectedPic="false" id="minPictrue${address.id}"><img src="<%=request.getContextPath()%>/HRTWEB/images/right.png"/></div>
					                  </div>
					            </div>
				            </li>
						</c:if>
						<c:if test="${address.isdefault==0}">
						
				            <li>
					            <div class="innerDIV" id="address${address.id}" isselected="false" objId="${address.id}">
				                      <div style="height: 20px">
					                      <span>${address.province}</span>
					                      <span>${address.city}</span>
					                      <span>(</span>
					                      <span>${address.receiver}收</span>
					                      <span>)</span>
					                  </div>
					                  <div style="height: 50px">
					                      <span>${address.area}</span>
					                      <span>${address.address}</span>
					                      <span>${address.mobile}</span>
					                  </div>
					                  <div style="height: 20px;vertical-align:bottom;position:relative;">
						                  <a href="#" id="editBtn" data-toggle="modal" memberId="${hrtMember.id}" addressId="${address.id}">修改</a>
						                  <a href="#" addressId="${address.id}" memberId="${hrtMember.id}" id="setDefaultBtn">设为默认</a>
						                  <%--  <div class="curmarker" id="curmarker${address.id}"></div> --%>
						                  <div class="minPicture" isselectedPic="false" id="minPictrue${address.id}"><img src="<%=request.getContextPath()%>/HRTWEB/images/right.png"/></div>
					                  </div>
					            </div>
				            
				       
				            </li>
						</c:if>
			       
					</c:forEach>
				</ul>
		 </div>
        </td>
        </tr>										
	    <tr>
        	<td class="buyGift buyGift-table-tboder" colspan="2">
            	<button type="button" id="addBtn" data-toggle="modal" memberId="${hrtMember.id}">添加新地址</button>
            </td>
        </tr>
	</table>
    </div>
    <div class="buyGift-div">
        <table class="buyGift-table" cellspacing="0" cellpadding="0">
            <tr>
                <td colspan="5" class="buyGift-table-trboder">确认订单信息    订单编号：${orderCode}</td>
            </tr>
            <tr class="buyGift-middle">
                <td class="buyGift-table-bboder">礼品</td>
                <td class="buyGift-table-bboder">单价（元）</td>
                <td class="buyGift-table-bboder">数量</td>
                <td class="buyGift-table-bboder">优惠方式</td>
                <td class="buyGift-table-bboder">小计（元）</td>
            </tr>
            <tr class="buyGift-middle">
                <td >${giftDetail.gdName}</td>
                <td >${giftDetail.salePrice}</td>
                <td >${detail.total}</td>
                <td ></td>
                <td id="tempSummery">${detail.summery}</td>
            </tr>
            
        </table>
    </div>
    <div class="buyGift-div">
        <form action="<%=request.getContextPath()%>/web/orderInfor/save.do" name="webOrderInfo" id="webOrderInfo" method="post">
            <!-- 订单基本信息 -->
            <table class="buyGift-table" cellspacing="0" cellpadding="0" style="display:none;">
                <tr>
                    <td><input value="${orderCode}" type="hidden" name="orderCode" id="orderCode"/></td><!-- 订单编号 -->
                    <td><input value="${hrtMember.id}" type="hidden" name="memberId" id="memberId"/></td><!-- 会员ID -->
                    <td><input  type="hidden" name="summery" id="summery" value="${detail.summery}"/></td><!-- 订单金额 -->
                    <td><input  type="hidden" name="mailFeed" id="mailFeed" value="0"/></td><!-- 邮费 -->
                    <td><input  type="hidden" name="receAddr" id="receAddr"/></td><!-- 收货地址 -->
                    <td colspan="2"><input type="hidden"  name="postCode" id="postCode" value="${address.postCode}"/></td><!-- 邮政编码 -->
                </tr>
                <tr>
                    <td><input type="hidden"  name="province" id="province" value="${address.province}"/></td><!-- 收货地址 -->
                    <td><input value="${hrtMember.mbrName}" type="hidden"  name="memberName" id="memberName"/></td><!-- 会员名 -->
                    <td colspan="2"><input  type="hidden"  name="receiver" id="receiver" value="${address.receiver}"/></td><!-- 收货人 -->
                </tr>
                <!-- 订单详细信息 -->
                <tr>
                    <td><input value="${giftDetail.giftName}" type="hidden"  name="details[0].giftName" id="giftName"/></td><!-- 礼品名称 -->
                    <td><input value="${giftDetail.giftId}" type="hidden"  name="details[0].giftId" id="giftId"/></td> <!-- 礼品id -->
                    <td colspan="2"><input value="${giftDetail.giftCode}" type="hidden"  name="details[0].giftCode" id="giftCode"/></td><!-- 礼品编号 -->
                     <td><input value="${giftDetail.gdCode}" type="hidden"  name="details[0].gdCode" id="gdCode"/></td><!-- 礼品规格编号 -->
                     <td><input value="${giftDetail.gdName}" type="hidden"  name="details[0].gdName" id="gdName"/></td><!-- 礼品规格名称 -->
                </tr>
                <tr>
                     <td><input value="${giftDetail.salePrice}" type="hidden"  name="details[0].salePrice" id="salePrice"/></td><!-- 礼品规格单价 -->
                     <td><input value="${detail.total}" type="hidden"  name="details[0].total" id="total"/></td><!-- 礼品规格数量 -->
                     <td><input value="${detail.summery}" type="hidden"  name="details[0].summery" id="summery"/></td><!-- 总价 -->
                     <td><input value="${giftDetail.id}" type="hidden"  name="details[0].giftDetailId" id="giftDetailId"/></td><!-- 礼品规格id -->
                </tr>
            </table>
            
      
        <table class="buyGift-table" cellspacing="0" cellpadding="0">
           <tr>
               <td colspan="2" class="buyGift-table-tboder">给收货人的卡片祝福语：<br/>
                  <textarea type="text" rows="2"  cols="53" name="bless" id="bless" style="resize:none;" placeholder="我们有附赠祝福卡片的哦，您可以留下您的祝福语喔!"></textarea>
               </td>
               <td class="buyGift-table-tboder">运送方式</td>
               <td class="buyGift-table-tboder">普通配送
                 <select id="commentStatus" class="commentStatus" onChange="changePostType(this.value);" style="width:100px;height:30px;">
                   
                 </select>
               </td>
               <td class="buyGift-table-tboder buyGift-right" id="postCost">0.00</td>
           </tr>
           <tr>
	           <td colspan="2">给何人堂留言：<br/>
	           <textarea type="text" rows="2" overflow-y="scroll" cols="53" name="note" id="note" style="resize:none;" placeholder="您可以对我们礼品提出特别要求！我们会尽量满足您的哦..."></textarea>
	           </td>
               <td >
                   <div class="giftPassWord">
						<a href="javascript::">设置礼品盒密码：<div>我们的每一个礼品盒都是会有一个密码的，收货人要凭借密码才能打开礼品盒的哦..</div>
						</a>
						<input type="text" size="25" name="OpenPassword" id="OpenPassword" placeholder="请在此设置您的礼品盒密码"/>
				   </div>
				</td><!-- 密码锁 -->
						
               <td id="showOrhide"></td>
               <td class="buyGift-right"><!-- 1.00 --></td>
           </tr>
           <%-- <tr><td>播放
           	<audio controls="controls">
  			<source src="<%=request.getContextPath()%>/HRTWEB/video/shalong.mp3" type="audio/mp3">
  			
			</audio>
			
			<canvas id="canvas" width="220" height="100"></canvas>
           </td></tr> --%>
           <tr>
                <td colspan="3" class="buyGift-table-bboder"></td>
                <td class="buyGift-right buyGift-table-bboder">店铺合计(含运费)：</td>
                <td class="buyGift-table-bboder"><span class="buyGift-fontRight"  id="storeCost">${detail.summery}</span></td>
            </tr> 
        </table>
        <div class="buyGift-divAdress">
              <p class="buyGift-right">实付款：<span class="buyGift-fontRight" id="realCost">${detail.summery}</span></p>
              <p class="buyGift-right">送寄至：<span id="currentAddress">${address.province}${address.city}${address.address}</span></p>
              <p class="buyGift-right">收件人：<span id="currentReceiver">${address.receiver}</span></p>
        </div>
         <div class="buyGift-submitDiv"><button type="button" id="orderSubmit" class="buyGift-btn">提交订单</button> </div>
         </form>
    </div>
</div>
<div id="footer" class="footer" style="clear:both">
<%@include file="foot.jsp"%> 
</div>
</body>
</html>
